home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-01-03 | 1.7 KB | 77 lines | [TEXT/KAHL] |
- /****
- * CNDPicture.c
- *
- * Copyright © 1992 NeoLogic Systems. All rights reserved.
- *
- ****/
-
- #include "NeoTypes.h"
- #include "CNDPicture.h"
- #include "CNeoDemoDoc.h"
- #include "CNeoDLOGDialog.h"
- #include "CNeoDialogText.h"
-
- /* PICT IDs in dialog for signaling show/hide lower items */
- #define kUpSigID 131
- #define kSideSigID 130
- #define kDownSigID 129
-
- void CNDPicture::INDPicture(short aID, CView *anEnclosure, CBureaucrat *aSupervisor, short aWidth, short aHeight,
- short aHEncl, short aVEncl, SizingOption aHSizing, SizingOption aVSizing)
- {
- IPicture(anEnclosure, aSupervisor, aWidth, aHeight, aHEncl, aVEncl, aHSizing, aVSizing);
-
- UsePICT(aID);
- fState = FALSE;
- }
-
- void CNDPicture::DoClick(Point hitPt, short modifierKeys, long when)
- {
- Rect tempRect;
- long ticks;
-
- SetOrigin((short)hOrigin, (short)vOrigin);
- LongToQDRect(&aperture, &tempRect);
- UsePICT(kSideSigID);
- EraseRect(&tempRect);
- Draw(&tempRect); /* show intermediate PICT */
- Delay(15, &ticks);
- EraseRect(&tempRect);
- RestoreEnvironment();
-
- Zoom(!fState);
- }
-
- Boolean CNDPicture::isZoomed(void)
- {
- return fState;
- }
-
- void CNDPicture::Zoom(Boolean aOut)
- {
- short id;
- short width;
- short height;
- CNeoDemoDoc * document;
-
- if (fState != aOut) {
- width = macPort->portRect.right - macPort->portRect.left;
- document = ((CNeoDemoDoc *)((CNeoDLOGDialog *)itsSupervisor)->itsSupervisor);
-
- if (aOut) {
- height = document->fBottomLine;
- id = kDownSigID;
- document->fSearchText->Show(); /* so tab includes this field */
- }
- else {
- height = document->fDivideLine -2;
- id = kUpSigID;
- document->fSearchText->Hide(); /* so tab skips this field */
- }
-
- ((CNeoDLOGDialog *)itsSupervisor)->ChangeSize(width, height);
- UsePICT(id);
- fState = aOut;
- Refresh();
- }
- }